#include<bits/stdc++.h>
using namespace std;
void longPascalTriangle(long long n)
{
    long long maxrow = (n + 1) / 2;
    vector<long long> v(maxrow + 1);
    v[0] = 1; // 哨兵节点
    bool bOddRow = true; // 奇数行则为true
    long long num = 0; // 需要计算的元素数量
    for (long long row = 1; row <= n; row++)
    {
        if (bOddRow)
        {
            num++;
            v[num] = v[num - 1];
        }
        for (long long i = num; i > 1; i--)
            v[i] += v[i - 1];

        for (long long i = 1; i <= num; i++) // 正向打印
            cout << v[i] << " ";
        if (!bOddRow)  // 对于偶数行最后一个元素需要再打印一遍
            cout << v[num] << " ";
        for (long long i = num - 1; i >= 1; i--) // 反向打印
            cout << v[i] << " ";
        cout << endl;
        bOddRow = bOddRow ? false : true; // 行号+1后改变了奇偶性
    }
}

int main() {
    long long n;
    cin >> n;
    longPascalTriangle(n);
    return 0;
}